package com.cgy.utils.jmx.jvm.os;

import com.cgy.utils.jmx.IJvmInfoFactory;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author CHTK
 */
public class OsFactory extends IJvmInfoFactory {

    @Override
    public void status() {
        Map<String, String> fields = fields();
        for (Map.Entry<String, String> stringStringEntry : fields.entrySet()) {
            put(stringStringEntry.getKey(), System.getProperty(stringStringEntry.getKey()), stringStringEntry.getValue());
        }
    }

    @Override
    public Map<String, String> fields() {
        return new HashMap<String, String>() {
            {
                put("os.name", "操作系统的名称");
                put("os.version", "操作系统的架构");
                put("os.arch", "操作系统的版本");
            }
        };
    }

}
